package managers.conversationManager;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

import utils.StackTracePrinter;

public class DefaultTCPSocket implements GenericSocket {

	private Socket socket;
	
	public DefaultTCPSocket (Socket socket) {
		this.socket = socket;
	}
	
	
	
	@Override
	public InputStream getInputStream() {
		try {
			return socket.getInputStream();
		} catch (IOException e) {
			StackTracePrinter.print(e);
			return null;
		}
	}

	@Override
	public OutputStream getOutputStream() {
		try {
			return socket.getOutputStream();
		} catch (IOException e) {
			StackTracePrinter.print(e);
			return null;
		}
	}

	@Override
	public void close() {
		try {
			socket.close();
		} catch (IOException e) {
			//do nothing
			StackTracePrinter.print(e);
		}
		
	}
	
	

}
